<?php
namespace Admin\Model;
use Think\Model;
class AdminAuthModel extends Model{
    protected $_validate =array(
      array('mid,mids','identicalNull','',0,'callback'),
      array('mid,ordid','identicalEnum','',0,'callback'),
      array('name','1,40','{%admin_role_group_name_length}',0,'length'),
      array('remark','0,200','{%admin_role_group_remark_length}',0,'length'),   
    );
    protected  $_auto=array(
      array('ordid',255),
      array('addtime','time',1,'function'),
      array('updatetime','time',3,'function'),  
    );
    //admin_group读取权限组信息
    public function auth_group_cache(){
        $group_data=$this->field('id,mid,nmae,msid,mid')->order('ordid,id asc')->select();
        foreach ($group_data as $val){
            $group[$val['mid']][]=$val;
        }
        F('auth_group',$group);
        return $group;
    }
    
    
}